Socket
Socket
Sign inDemoInstall

@types/acorn

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/acorn

TypeScript definitions for Acorn


Version published
Weekly downloads
1.6M
increased by7.93%
Maintainers
1
Weekly downloads
 
Created

What is @types/acorn?

The @types/acorn package provides TypeScript type definitions for the Acorn JavaScript parser. It is useful for developers who use TypeScript and need type safety and IntelliSense support when working with Acorn.

What are @types/acorn's main functionalities?

Type Definitions for Acorn Parser

This code sample demonstrates how to use the @types/acorn package to provide type definitions when using the Acorn parser to parse a piece of JavaScript code. It sets up parser options with type safety and parses a simple script, logging the resulting AST.

import * as acorn from 'acorn';

const options: acorn.Options = {
  locations: true,
  ecmaVersion: 2020
};

const code = `let x = 10;`;
const ast = acorn.parse(code, options);
console.log(ast);

Other packages similar to @types/acorn

FAQs

Package last updated on 06 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc